/*
 * Copyright (c) gitee.com/jiandong001.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

export const enum YogaMeasureMode {
  UNDEFINED = 0,
  EXACTLY = 1,
  AT_MOST = 2
}


export function getYogaMeasureModeFromNumber(value: number): YogaMeasureMode | never {
  switch (value) {
    case 0: return YogaMeasureMode.UNDEFINED;
    case 1: return YogaMeasureMode.EXACTLY;
    case 2: return YogaMeasureMode.AT_MOST;
    default: throw new Error("Unknown enum value: " + value);
  }
}


//export class YogaMeasureMode {
//
//  public static readonly UNDEFINED = 0
//  public static readonly EXACTLY = 1
//  public static readonly AT_MOST = 1
//
//  private readonly mIntValue: number;
//
//  constructor(intValue: number) {
//    this.mIntValue = intValue;
//  }
//
//  public intValue(): number {
//    return this.mIntValue;
//  }
//
//  public static fromInt(value: number): number | never {
//    switch (value) {
//      case 0: return YogaMeasureMode.UNDEFINED;
//      case 1: return YogaMeasureMode.EXACTLY;
//      case 2: return YogaMeasureMode.AT_MOST;
//      default: throw new Error("Unknown enum value: " + value);
//    }
//  }
//}
